<html>
<head>
<script type="text/javascript">
var xmlhttp;
function load_item(url)
{
	xmlhttp=new XMLHttpRequest();
	xmlhttp.onreadystatechange=state_Change;
	xmlhttp.open("GET",url,false);
	xmlhttp.send(null);
}
function state_Change()
{
if (xmlhttp.readyState==4)
  {// 4 = "loaded"
  if (xmlhttp.status==200)
    {// 200 = OK
    // ...our code here...
	document.getElementById('question').value=xmlHttp.responseText;
    }
  else
    {
    alert("Problem retrieving XML data");
    }
  }
}

</script>
</head>
<body onload="load_item('list/sheets')">
<script type="text/javascript">
html= ' Welcome {{ user }} ! (<a href="{{ signout }}">sign out</a>)\
<form method="post" action="" name="Mioform"><br>\
<textarea onfocus="if (this.value == {{ noreptext }}) this.value=\'\'" cols="50" rows="3" name="question" id="question">{{ question }}</textarea>\
&nbsp; <input onclick="document.Mioform.goodbutton.disabled=document.Mioform.badbutton.disabled=document.Mioform.sosobutton.disabled=false;document.Mioform.answer.value= \'{{ answer }}\'" name="showanswer" value="show\ answer" type="button"><br><br><textarea cols="50" rows="3" name="answer"></textarea><br><input name="key" type="hidden" value = "{{ key }}" ><br><input name="archivio" type="hidden" value = "{{ archivio }}" ><br>\
<input disabled="disabled" value="Good" name="Level" id="goodbutton" type="submit">&nbsp; &nbsp; &nbsp;<input disabled="disabled" value="Soso" name="Level" id="sosobutton" type="submit">\
&nbsp; &nbsp; &nbsp;<input disabled="disabled" id="badbutton" name="Level" value="Bad" type="submit">\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\
&nbsp; <input name="Add" value="Add" onclick="document.Mioform.key.value=\'\'" type="submit">\
</form>\
<br>'
document.write(html);
//document.write ('ciao');
</script>
</body>
</html>
